package cn.hh.wechatkit.pojo.token;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * Created by HMH on 2017/3/24.
 * autho2的Token
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class WxToken_AuthoAccessToken {

    private String access_token;//网页授权接口调用凭证，和基础支持的accesss_token不同
    private long expires_in;//超时时间
    private long expires_time;//
    private String refresh_token;//用户刷新access_token
    private String openid;//用户唯一标识
    private String scope;//用户授权作用域
    private String[] scopes;
    private String errcode;//错误码
    private String errmsg;//错误信息

    public boolean isExpired() {
        return expires_time > System.currentTimeMillis();
    }

    public Boolean hasError() {
        return errcode!=null && !"0".equals(errcode);
    }
}
